package com.autumn.zero.file.storage.configure;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.autumn.zero.file.storage.application.services.IFileUploadManager;
import com.autumn.zero.file.storage.application.services.impl.FileUploadManagerImpl;
import com.autumn.zero.file.storage.services.IFileAttachmentInformationService;
import com.autumn.zero.file.storage.services.impl.FileAttachmentInformationServiceImpl;

/**
 * 文件存储配置
 * 
 * @author 老码农 2019-03-18 18:04:33
 */
@Configuration
public class AutumnZeroFileStorageConfiguration {

	/**
	 * 文件信息服务
	 * 
	 * @return
	 */
	@Bean
	@ConditionalOnMissingBean(IFileAttachmentInformationService.class)
	public IFileAttachmentInformationService autumnZeroFileAttachmentInformationService() {
		return new FileAttachmentInformationServiceImpl();
	}

	/**
	 * 文件上传管理
	 * 
	 * @return
	 */
	@Bean
	@ConditionalOnMissingBean(IFileUploadManager.class)
	public IFileUploadManager autumnZeroFileUploadManager() {
		return new FileUploadManagerImpl();
	}
}
